# import numpy as np
# import tables as tb
# ndim = 10000
# h5file = tb.openFile('test.h5', mode='w', title="Test Array")
# root = h5file.root
# h5file.createArray(root, "test", np.zeros((ndim,ndim), dtype=float))
# h5file.close()
import functools
from collections import Iterable
idd = isinstance('abc', Iterable) # str是否可迭代

print(idd)

print([x * x for x in range(1, 11)])
print([x * x for x in range(1, 11) if x % 2 == 0])

print([m + n for m in 'ABC' for n in 'XYZ'])

import os # 导入os模块，模块的概念后面讲到
print([d for d in os.listdir('.')]) # os.listdir可以列出文件和目录

L = ['Hello', 'World', 'IBM', 'Apple']
print([s.lower() for s in L])

L = ['Hello', 'World', 18, 'Apple', None]
print([s.lower() for s in L if isinstance(s, str)])

g = (x * x for x in range(10))

for n in g: print(n)

# for ix in range(100):
#     for iy in range(1000):
#         val = dset[ix, iy]
#         if val < 0: dset[ix, iy] = 0

